package com.pond.pond.domain;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pond.common.core.annotation.Excel;
import com.pond.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 鱼塘管理对象 pond
 * 多租户支持：增加 deptId 字段用于部门隔离
 */
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@Data
@TableName("pond")
public class Pond extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 所属部门（租户）ID */
    @Excel(name = "所属部门ID")
    private Long deptId;

    /** 鱼塘名称 */
    @Excel(name = "鱼塘名称")
    private String name;

    /** 鱼塘背景图 */
    @Excel(name = "鱼塘背景图")
    private String backgroundUrl;

    /** 是否回鱼 0=否 1=是 */
    @Excel(name = "是否回鱼 0=否 1=是")
    private Integer isReturnFish;

    /** 鱼存量（kg） */
    @Excel(name = "鱼存量", readConverterExp = "kg")
    private BigDecimal currentWeight;

    /** 实时计算的当前存鱼量（不存库） */
    @TableField(exist = false)
    private BigDecimal actualWeight;

    /** 备注 */
    @Excel(name = "备注")
    private String remark;

    /** 鱼种 */
    @Excel(name = "鱼种")
    @TableField("fishTypes")
    private String fishTypes;

    /** 多段计价（不存库） */
    @TableField(exist = false)
    private List<PriceSegment> priceSegments;

    /** 查询参数（非数据库字段） */
    @TableField(exist = false)
    private Map<String, Object> params;

    /** 搜索关键词（非数据库字段） */
    @TableField(exist = false)
    private String searchValue;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", id)
                .append("deptId", deptId)
                .append("name", name)
                .append("backgroundUrl", backgroundUrl)
                .append("isReturnFish", isReturnFish)
                .append("currentWeight", currentWeight)
                .append("actualWeight", actualWeight)
                .append("remark", remark)
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
